﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading;

namespace NW
{
	class Program
	{
		static void Main(string[] args)
		{
			TestClient C = new TestClient();
			Console.WriteLine(C.Connected);
			Console.ReadKey(true);
			Console.WriteLine("Send packet");
			C.SendPacket(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
			Console.ReadKey(true);
			Console.WriteLine("Closing client");
			C.Disconnect();
			Console.ReadKey(true);
		}

		static void C_OnString(NWClient sender, string data)
		{

		}
	}
	class TestClient : NWClient
	{
		public TestClient()
			: base("localhost", 6000)
		{
			OnString += (x, y) =>
			{
				Console.WriteLine("STRING: ");
			};
			OnData += (x, y) =>
			{
				Console.WriteLine("DATA: ");
			};
			Disconnected += x =>
			{
				Console.WriteLine("CLI: Disconnected");
			};
			ExitReceived += x => Console.WriteLine("CLI: Server forced to exit");
		}
		protected override bool _ProcessMessage()
		{
			return base._ProcessMessage();
		}
	}
}